home *** CD-ROM | disk | FTP | other *** search
- ATARI MACHINE SPECIFIC LIBRARY
-
-
-
- NAME
- DoubleBuffer - encapsulated double buffering support
-
- SYNOPSIS
- #include <DoubleBuffer.h>
-
- class DoubleBuffer
-
- DoubleBuffer* Pages
-
- DESCRIPTION
- A commonly used technique for providing smoothe graphics is to use
- two (or sometimes more) graphics screens. While displaying one screen,
- the programmer writes on the other, then waits until the vertical
- retrace (the time when the physical screen is not being modified)
- then flips them - displaying the newly written screen while writing
- on the old one.
-
- VARIABLES
- BoubleBuffer* Pages
- All graphics in the Atari Machine Specific Library draws on the
- screens defined by this variable. Initially, it simply represents
- the standard desktop screen, but a programmer will usually set
- it to point to a new DoubleBuffer representing a more useful pair
- of screens.
-
- CLASSES
- DoubleBuffer encapsulates the double buffering concept.
-
- CLASS MEMBERS
- DoubleBuffer::
- DoubleBuffer() - A double buffer with two screens in the
- current resolution.
- DoubleBuffer(Screen&,Screen&) - A specific pair of screens.
-
- void Flip() - Swap pages.
- void Flop() - Swap pages unsynced (rarely useful).
-
- The following methods are mainly for internal AMS Library usage,
- but are available for the programmer to add extensions.
-
- char *Location() - Location of image area to draw on.
-
- Screen& NowShowing() - Actual screen being displayed.
- Screen& Current() - Actual screen to draw on.
-
- short Pulse - A value that changes from 0 to 1 according
- to the current displayed screen.
-
- USAGE
- For smooth display, the program should never draw on the currently
- showing screen.
-
- Generally, the start of a program will set the value of Pages to
- a new pair of screens, then the main animation loop will look
- like this:
-
- while (...) {
- Wipe old graphics
- Draw new graphics
- Pages->Flip();
- }
-
- SEE ALSO
- Screen, Sprite, FastCounter, BlockMap
-
- BUGS
- We should probably support more than 2-screen double buffering.
- This extension could be easily added, but since we have never
- really found a use for it, we haven't bothered.
-
- AUTHOR
- Warwick Allison, 1992.
- warwick@cs.uq.oz.au
-
- COPYING
- This functionality is part of the Atari Machine Specific Library,
- and is Copyright 1992 by Warwick W. Allison.
-
- The Atari Machine Specific Library is free and protected under the
- GNU Library General Public License.
-
- You are free to copy and modify these sources, provided you acknowledge
- the origin by retaining this notice, and adhere to the conditions
- described in the GNU LGPL.
-